home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 14014 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: news.ichange.com!newsmaster
  2. From: Jesse Liberty <jl@staff.ichange.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: NEWBIE : Quicksort
  5. Date: Thu, 28 Mar 1996 07:31:21 -0500
  6. Organization: AT&T
  7. Message-ID: <315A8699.3F8F@staff.ichange.com>
  8. References: <4j4ruf$gf4@news1.h1.usa.pipeline.com> <Pine.SOL.3.91.960325221334.202B-100000@orion> <3159337A.2DB5@staff.ichange.com> <Doxpq0.2t5@research.att.com>
  9. NNTP-Posting-Host: 140.244.99.60
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (Win95; I)
  14. CC: jl@staff.ichange.com
  15.  
  16. Andrew Koenig wrote:
  17. > In article <3159337A.2DB5@staff.ichange.com> Jesse Liberty <jl@staff.ichange.com> writes:
  18. > > Sure, in my book Teach Yourself MORE C++ In 21 Days I show how to write a number of sorts, quicksort among them. Here's the
  19. > > basic code.
  20. >  <code elided>
  21. > I hope this isn't what's in the book.
  22. > For one thing, this code doesn't sort the elements of an array in the ordinary
  23. > sense.  Rather, it sorts an array of pointers based on comparing the values
  24. > to which the pointers point.  
  25.  
  26. Yes, my point was not to supply the definitive code for qsort but to get him started looking at a somewhat simple working 
  27. example. The book takes on the shortcoming you mention in subsequent discussion. You are right, however, in my haste I didn't 
  28. make any of that clear in my message.
  29.  
  30.  
  31. > What I'm trying to argue is that good algorithms are not easy to design,
  32. > even when they appear simple.  Libraries are there for a reason, and you
  33. > should use them whenever it makes sense.
  34.  
  35.  
  36. Agreed, and I didn't mean to suggest otherwise; rather that it makes sense to have a good idea of the fundamentals of how the 
  37. sort works; optimization and creating a general solution is of course a much harder task.  Thanks for your gentle reply. -j
  38.